<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description"
          content="{% block meta_description %}{% endblock %}">

    <title>{% block title %}{% endblock %}</title>
    <style>{% block style %}{% endblock %}</style>

    <link
      rel="stylesheet"
      href="{{ url_for('static', filename='styles/vendor/bootstrap.min.css') }}">
    <link
      rel="stylesheet"
      href="{{ url_for('static', filename='styles/main.css') }}">
    <link
      rel="stylesheet"
      href="{{ url_for('static', filename='styles/vendor/font-awesome.min.css') }}">
    <link
      rel="stylesheet"
      href="{{ url_for('static', filename='styles/mystyle.css') }}">

<script src="{{ url_for('static', filename='scripts/vendor/jquery-2.1.3.min.js') }}"></script>
<!--<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>-->
    <!--<script src="https://code.jquery.com/jquery-1.12.2.min.js"-->
            <!--integrity="sha256-lZFHibXzMHo3GGeehn1hudTAP3Sc0uKXBXAzHX1sjtk="-->
            <!--crossorigin="anonymous"></script>-->

    {% if config['ANALYTICS_GOOGLE_UA'] %}
      <script>
        (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
        (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
        m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
        })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

        ga('create', "{{ config['ANALYTICS_GOOGLE_UA'] }}", 'auto');
        ga('send', 'pageview');
      </script>

    {% endif %}
    {% block extra %}{% endblock %}
  </head>

  <script>
  $(document).ready(function() {
    $('#preview').on("click", "td", function() {
      if ($(this).hasClass("info"))
      {
        $(this).removeClass("info");
      } else {
        $(this).addClass("info");
      }
    });

    $('#preview').on("mouseenter", "td", function() {
      if (!$(this).hasClass("info"))
      {
        $(this).addClass("active");
      }
    })

    $('#preview').on("mouseleave", "td", function() {
        $(this).removeClass("active");
    })

    $("#preview-form").submit( function() {
      var finished = "[";
      $("#preview td").each(function() {
        if ($(this).hasClass("info")) {
          finished = finished + "'" + $(this).text() + "',";
        }
      })
      finished = finished + "]";

      $('<input />').attr('type', 'hidden')
       .attr('name', "finished")
       .attr('value', finished)
       .appendTo('#preview-form');

       return true;
    });


  });

  </script>

  <body>
    <nav class="navbar navbar-default navbar-fixed-top">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed"
                  data-toggle="collapse" data-target="#navbar"
                  aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a href="{{ url_for('schedule.index') }}">
            <img src="{{ url_for('static', filename='images/UCIrvine.png') }}"
                 class="img-responsive" height="48" width="220"
                 title="UC Irvine" alt="UC Irvine"/>
          </a>
        </div>
      </div>
    </nav>

    <main class="container">
      <div class="md-margin-top">{% block heading %}{% endblock %}</div>
      {% block body %}{% endblock %}
    </main>

    <footer class="footer text-center">
      <div class="container">
        <ul class="list-inline">
          <li class="text-muted">Course Scheduling &copy; 2017</li>
          <li><a href="{{ url_for('page.privacy') }}">Privacy Policy</a></li>
          <li><a href="{{ url_for('page.terms') }}">Terms of Service</a></li>
        </ul>
      </div>
    </footer>
  </body>
</html>
